Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: QuickTime Components

Previous | Overview | Contents | Next |

Managing Your Panel's Settings

To allow the sequence grabber to work with your panel's settings, your panel component must allow the sequence grabber to

Listing 3 gives an example in which the settings are managed in a user list that contains tick count information for a panel component for PICT images.

Listing 3 Managing the settings for a panel component

pascal ComponentResult PictPanelPanelGetSettings
                            (PictPanelGlobals store, SGChannel c,
                             UserData *result, long flags)
{
    OSErr           err;
    UserData        ud;
    Boolean         ticksShowing;
    /* create a user data list containing your state */
    if (err = NewUserData (&ud)) goto bail;
    if (err = SGGetShowTickCount (c, &ticksShowing)) goto bail;
    if (err = SetUserDataItem (ud, &ticksShowing,
                                        sizeof (ticksShowing),
                                        sgcPictShowTicksType, 1)) goto bail;

bail:
    if (err) {
        DisposeUserData(ud);
        ud = 0;
    }
    *result = ud;

    return err;
}

pascal ComponentResult PictPanelPanelSetSettings
                                    (PictPanelGlobals store, SGChannel c,
                                     UserData ud, long flags)
{
    Boolean ticksShowing;

    /* restore the state from the specified user data list */
    if (GetUserDataItem (ud, &ticksShowing,
                                sizeof (ticksShowing),
                                sgcPictShowTicksType, 1) == noErr)
        SGSetShowTickCount (c, ticksShowing);

    return noErr;
}

© 1999 Apple Computer, Inc.

Previous | Overview | Contents | Next